﻿<?xml version="1.0" encoding="utf-8"?>
<!--
        作者：          刘乐意
        更新时间：      20160920
        用途：          生成数据库字符串字段定义
-->
<xsl:stylesheet version="2.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:fn="http://www.w3.org/2005/xpath-functions">
	<xsl:output method="text" indent="no" encoding="utf-8" byte-order-mark="no"/>  
	<xsl:template match="/">
	<xsl:variable name="StringTypeDefine" select="document('../model/0101_StringTypeDefine.xml')"/>
	<xsl:variable name="EnumTypeDefine" select="document('../model/0102_EnumTypeDefine.xml')"/>
	<xsl:variable name="BooleanTypeDefine" select="document('../model/0103_BooleanTypeDefine.xml')"/>
	<xsl:variable name="DateTypeDefine" select="document('../model/0104_DateTypeDefine.xml')"/>
	<xsl:variable name="NumberTypeDefine" select="document('../model/0105_NumberTypeDefine.xml')"/>
	<xsl:variable name="IntegerTypeDefine" select="document('../model/0106_IntegerTypeDefine.xml')"/>
	<xsl:result-document encoding="utf-8" method="text" href="./generate/php/LZConstValue.php">&lt;?php
/*
        作者：刘乐意
        时间：20150113
        用途：定义各种Label
*/

<xsl:for-each select="$EnumTypeDefine//Enum">
	<xsl:variable name="PRE" select="@prefix"/>
<xsl:for-each select="Item">
define('VL_<xsl:value-of select="upper-case($PRE)"/><xsl:value-of select="upper-case(@itemname)"/>','<xsl:value-of select="@value"/>');
</xsl:for-each>
</xsl:for-each>
<xsl:for-each select="$BooleanTypeDefine//Boolean">
	<xsl:variable name="PRE" select="@prefix"/>
<xsl:for-each select="Item">
define('VL_<xsl:value-of select="upper-case($PRE)"/><xsl:value-of select="upper-case(@itemname)"/>','<xsl:value-of select="@value"/>');
</xsl:for-each>
</xsl:for-each>
	</xsl:result-document>
	</xsl:template>  
</xsl:stylesheet>